package values.item
{
import values.avatar.IPropertyProvider;


/**
 * EquipmentItemTemplateValue
 * @author jliang
 *
 */
public class EquipmentItemTemplateValue extends UpgradebleItemTemplateValue implements IPropertyProvider
{
	//==========================================================================
	//  Constructor
	//==========================================================================
	public function EquipmentItemTemplateValue()
	{
		super();
	}
	
	//==========================================================================
	//  Overridden methods: ItemTemplateValue
	//==========================================================================
	/**
	 *   <effect>
			<max_hp>10</max_hp>              <!-- 生命值 -->
			<init_mp>5</init_mp>              <!-- 能量值 -->
			<mp_recover>2</mp_recover>              <!-- 能量恢复效率 -->
			<normal_power></normal_power>              <!-- 战斗 -->
			<skill_power></skill_power>              <!-- 特技 -->
			<element_power></element_power>              <!-- 元素 -->
			<normal_defense>1</normal_defense>              <!-- 物理防御 -->
			<skill_defense>1</skill_defense>              <!-- 技能防御 -->
			<element_defense>1</element_defense>              <!-- 元素防御 -->
			<normal_damage>1</normal_damage>              <!-- 普通物理攻击力 -->
			<skill_damage>1</skill_damage>              <!-- 特技攻击力 -->
			<element_damage>1</element_damage>              <!-- 元素攻击力 -->
			<move_capability>2</move_capability>                 <!-- 移动力 -->
			<hit_rate>2</hit_rate>                 <!-- 命中等级 -->
			<dodge_rate>2</dodge_rate>                 <!-- 闪避等级 -->
			<penetrate_rate>2</penetrate_rate>                 <!-- 穿透等级 -->
			<resist_rate>2</resist_rate>                 <!-- 抵抗等级 -->
			<enforce_rate>2</enforce_rate>                 <!-- 强攻等级 -->
			<block_rate>2</block_rate>                 <!-- 抵挡等级 -->
			<block_effect>2</block_effect>                 <!-- 抵挡力 -->
			<toughness>2</toughness>                 <!-- 强韧等级 -->
			<crit_rate>2</crit_rate>                 <!-- 暴击等级 -->
			<crit_effect>2</crit_effect>                 <!-- 暴击伤害加成 -->
			<defense_rate>2</defense_rate>                 <!-- 御体等级 -->
			<suppress_rate>2</suppress_rate>                 <!-- 压制等级 -->
			<suppress_effect>2</suppress_effect>                 <!-- 压制力 -->
			<act_rate>2</act_rate>                 <!-- 先攻值 -->
	      </effect>
	 */		
	[Data(type="field", mapping="params")]
	override public function set params(value:*):void
	{
		super.params = value;
	}
	
	override public function get dynamicClassRef():Class
	{
		return EquipmentItemValue;
	}
	//==========================================================================
	//  Properties
	//==========================================================================	
	public function get firstUpgradeValue():ItemUpgradeValue
	{
		return getUpgradeByLevel(1);
	}
	
	/**
	 *  物品等级
	 * @return 
	 * 
	 */	
	public function get equipLevel():int
	{
		return int(params.equip_level);
	}
	
	/**
	 * 装备的颜色 
	 * @return 
	 * 
	 */	
	public function get color():uint
	{
		return uint(params.color);
	}
	
	/**
	 * 需求等级 
	 * @return 
	 * 
	 */	
	public function get requireLevel():int
	{
		return int(params.require_level);
	}
	
	/**
	 *  装备部位
	 * @return 
	 * 
	 */	
	public function get position():String
	{
		return String(params.position);
	}
	
	/**
	 *  装备类型
	 * @return 
	 * 
	 */	
	public function get equipType():String
	{
		return String(params.equip_type);
	}
	
	/**
	 *  生命值
	 * @return 
	 * 
	 */	
	public function get maxHP():Number
	{
		return Number(firstUpgradeValue.effect.max_hp);
	}
	
	/**
	 *  能量值
	 * @return 
	 * 
	 */	
	public function get initMP():Number
	{
		return Number(firstUpgradeValue.effect.init_mp);
	}
	
	/**
	 *  能量恢复效率
	 * @return 
	 * 
	 */	
	public function get mpRecover():Number
	{
		return Number(firstUpgradeValue.effect.mp_recover);
	}
	
	/**
	 *  战斗
	 * @return 
	 * 
	 */	
	public function get normalPower():Number
	{
		return Number(firstUpgradeValue.effect.normal_power);
	}
	
	/**
	 *  特技
	 * @return 
	 * 
	 */	
	public function get skillPower():Number
	{
		return Number(firstUpgradeValue.effect.skill_power);
	}
	
	/**
	 *  元素
	 * @return 
	 * 
	 */	
	public function get elementPower():Number
	{
		return Number(firstUpgradeValue.effect.element_power);
	}
	
	/**
	 *  物理防御
	 * @return 
	 * 
	 */	
	public function get normalDefense():Number
	{
		return Number(firstUpgradeValue.effect.normal_defense);
	}
	
	/**
	 *  技能防御
	 * @return 
	 * 
	 */	
	public function get skillDefense():Number
	{
		return Number(firstUpgradeValue.effect.skill_defense);
	}
	
	/**
	 *  元素防御
	 * @return 
	 * 
	 */	
	public function get elementDefense():Number
	{
		return Number(firstUpgradeValue.effect.element_defense);
	}
	
	/**
	 *  普通攻击力
	 * @return 
	 * 
	 */	
	public function get normalDamage():Number
	{
		return Number(firstUpgradeValue.effect.normalDamage);
	}
	
	/**
	 *  特技攻击力
	 * @return 
	 * 
	 */	
	public function get skillDamage():Number
	{
		return Number(firstUpgradeValue.effect.skill_damage);
	}
	
	/**
	 *  元素攻击力
	 * @return 
	 * 
	 */	
	public function get elementDamage():Number
	{
		return Number(firstUpgradeValue.effect.element_damage);
	}
	
	/**
	 *  移动力
	 * @return 
	 * 
	 */	
	public function get moveCapability():Number
	{
		return Number(firstUpgradeValue.effect.move_capability);
	}
	
	/**
	*  命中等级
	* @return 
	* 
	*/		
	public function get hitRate():Number
	{
		return Number(firstUpgradeValue.effect.hit_rate);
	}
	
	/**
	 *  闪避等级
	 * @return 
	 * 
	 */		
	public function get dodgeRate():Number
	{
		return Number(firstUpgradeValue.effect.dodge_rate);
	}
	
	/**
	 *  穿透等级
	 * @return 
	 * 
	 */		
	public function get penetrateRate():Number
	{
		return Number(firstUpgradeValue.effect.penetrate_rate);
	}
	
	/**
	 *  抵抗等级
	 * @return 
	 * 
	 */		
	public function get resistRate():Number
	{
		return Number(firstUpgradeValue.effect.resist_rate);
	}
	
	/**
	 *  强攻等级
	 * @return 
	 * 
	 */		
	public function get enforceRate():Number
	{
		return Number(firstUpgradeValue.effect.enforce_rate);
	}
	
	/**
	 *  抵挡等级
	 * @return 
	 * 
	 */		
	public function get blockRate():Number
	{
		return Number(firstUpgradeValue.effect.block_rate);
	}
	
	/**
	 *  抵挡力
	 * @return 
	 * 
	 */		
	public function get blockEffect():Number
	{
		return Number(firstUpgradeValue.effect.block_effect);
	}
	
	/**
	 *  强韧等级
	 * @return 
	 * 
	 */		
	public function get toughness():Number
	{
		return Number(firstUpgradeValue.effect.toughness);
	}
	
	/**
	 *  暴击等级
	 * @return 
	 * 
	 */		
	public function get critRate():Number
	{
		return Number(firstUpgradeValue.effect.crit_rate);
	}
	
	/**
	 *  暴击伤害加成
	 * @return 
	 * 
	 */		
	public function get critEffect():Number
	{
		return Number(firstUpgradeValue.effect.crit_effect);
	}
	
	/**
	 *  御体等级
	 * @return 
	 * 
	 */		
	public function get defenseRate():Number
	{
		return Number(firstUpgradeValue.effect.defense_rate);
	}
	
	/**
	 *  压制等级
	 * @return 
	 * 
	 */		
	public function get suppressRate():Number
	{
		return Number(firstUpgradeValue.effect.suppress_rate);
	}
	
	/**
	 *  压制力
	 * @return 
	 * 
	 */		
	public function get suppressEffect():Number
	{
		return Number(firstUpgradeValue.effect.suppress_effect);
	}
	
	/**
	 *  先攻值
	 * @return 
	 * 
	 */		
	public function get actRate():Number
	{
		return Number(firstUpgradeValue.effect.act_rate);
	}
}
}



